program Summatorplus;

{$APPTYPE CONSOLE}

uses
  SysUtils;

type
  Rectangle = class
    public
      a, b: integer;
      procedure Square; virtual;
      procedure Updata;
    private
      s: integer;
  end;

  SmartRectangle = class (Rectangle)
    procedure SetRectangle (newa, newb: integer);
    procedure Square; override;
  end;

{ Rectangle }

procedure Rectangle.Square;
begin
  writeln (s);
end;

procedure Rectangle.Updata;
begin
  s:=a*b;
end;


{ SmartRectangle }

procedure SmartRectangle.SetRectangle(newa, newb: integer);
begin
  a:=newa;
  b:=newb;
  s:=a*b;
end;

procedure SmartRectangle.Square;
begin
  inherited;
  if (s=a*b) then
    writeln (s)
  else
    writeln ('You are stupid!');
end;

var
x: Rectangle;
y: SmartRectangle;

begin
  x:= Rectangle.Create;
  x.a:=2;
  x.b:=8;
  x.Updata;
  x.Square;
  readln;
  y:= SmartRectangle.Create;
  y.SetRectangle(4, 4);
  y.Square;
  readln;
  y.a:=3;
  y.b:=2;
  y.Square;
  readln;
end.
